package com.offcn.webui.controller;

import com.offcn.common.response.AppResponse;
import com.offcn.webui.service.ProjectFeignService;
import com.offcn.webui.vo.resp.ProjectVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Controller
public class IndexController {

    @Autowired
    private ProjectFeignService projectService;

    @RequestMapping("/")
    public String showIndex(Model model){
        AppResponse<List<ProjectVo>> allProject = projectService.getAllProject();
        model.addAttribute("projectList",allProject.getData());
        return "index";
    }
}
